<?php

namespace App\Http\Controllers\Api;

use App\Models\Category;

class CategoriesController extends ApiController
{
    /**
     *
     * @return mixed
     */
    public function index()
    {
        $categories = Category::where(['is_directory'=>1,'is_show'=>1])->with('children')->orderBy('sort')->get();
        $data['categories'] = $categories;
        return $this->success($data);
    }

}
